package com.cxc.news.pojo;

import javax.validation.constraints.NotBlank;
import java.util.ArrayList;
import java.util.List;

/**
 * 分类类
 */
public class Type {

    private Long id;
    @NotBlank(message = "分类名称不能为空")
    private String name;

    private Integer num;//辅助作用

    private List<News> news = new ArrayList<>();

    public Type(String name) {
    }

    public Type() {

    }

    public Type(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<News> getNews() {
        return news;
    }

    public void setNews(List<News> news) {
        this.news = news;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    @Override
    public String toString() {
        return "Type{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", num=" + num +
                ", news=" + news +
                '}';
    }
}
